home *** CD-ROM | disk | FTP | other *** search
/ Programmer Plus 2007 / Programmer-Plus-2007.iso / Programming / JAVA Utilities / JProxy 1.1.0 / EXAMPLES / SAMPLES / README.TXT
Encoding:
Text File  |  2003-04-29  |  2.0 KB  |  56 lines

  1. samples.jar
  2.  
  3. The file contains following JProxy examples: 
  4.  
  5. 1. Statefull Session Bean example. 
  6. package: com.jproxy.samples.ejb.test
  7.  
  8. 2. RMI Example
  9. package: com.jproxy.samples.rmi.test
  10.  
  11.  
  12. For simplicity reason samples.jar may be used for both client and server. 
  13. It contains source code and classes.
  14.  
  15. You may simply unzip samples.jar. 
  16.  
  17. 1. EJB Example
  18. To execute EJB client type from command prompt:
  19. java -cp samples.jar;proxyclient.jar;j2api.jar com.jproxy.samples.ejb.test.SessionClient Protocol://your_server_name:port
  20.  
  21. Where: 
  22. Protocol - "http" or "https". Default is "http"
  23.  
  24. YuorServerName - name of the host where your EJB Server is running. 
  25. If it is local then just use "localhost". 
  26. Default is "localhost".
  27.  
  28. Port - port of your Web Server (Servlet Engine) where JProxy deployed. 
  29. Default is 80.
  30.  
  31. If your client is local and uses http protocol with default port (80) 
  32. then you do not need to specyfy server URL
  33.  
  34. To use "https" protocol you have to enable SSL on your server. 
  35.  
  36. The sample bean and client have been successfully tested on JBoss, WebLogic, Orion and JONAS Application Servers. 
  37.  
  38.  
  39. 2. RMI Example
  40. First you have to start RMI TestServer object:
  41.  
  42. rmic has been used to produce stub and skeleton. 
  43.  
  44. Here are command lines to start server and client:
  45.  
  46. In this example TestServer uses JBoss Naming Service to bind the object. 
  47. JBoss clients JNDI library is jnp-client.jar.
  48. To use different Application Server use apropriate libraries for Naming Service.
  49.  
  50. Server:
  51. java -cp samples.jar;proxyclient.jar; -Djava.naming.factory.initial=com.jproxy.proxy.NamingContextFactory -Djava.naming.provider.url=localhost:8080 -Djava.rmi.server.codebase=file://samples.jar com.jproxy.samples.rmi.test.TestServer
  52. Notice "-D" parameter. The parameter assumes that TestServer starts from directory where samples.jar is. 
  53.  
  54. Client:
  55. java -cp samples.jar;proxyclient.jar; -Djava.naming.factory.initial=com.jproxy.proxy.NamingContextFactory -Djava.naming.provider.url=localhost:8080 com.jproxy.samples.rmi.test.TestClient
  56.